29 research outputs found

    Deciding KAT and Hoare Logic with Derivatives

    Get PDF
    Kleene algebra with tests (KAT) is an equational system for program verification, which is the combination of Boolean algebra (BA) and Kleene algebra (KA), the algebra of regular expressions. In particular, KAT subsumes the propositional fragment of Hoare logic (PHL) which is a formal system for the specification and verification of programs, and that is currently the base of most tools for checking program correctness. Both the equational theory of KAT and the encoding of PHL in KAT are known to be decidable. In this paper we present a new decision procedure for the equivalence of two KAT expressions based on the notion of partial derivatives. We also introduce the notion of derivative modulo particular sets of equations. With this we extend the previous procedure for deciding PHL. Some experimental results are also presented.Comment: In Proceedings GandALF 2012, arXiv:1210.202

    Pregrammars and Intersection Types

    Get PDF
    A representation of intersection types in terms of pregrammars is presented. Pregrammar based rewriting relations, corresponding respectively to type checking and inhabitation are defined and the latter is used to implement a Wajsberg/Ben-Yelles style alternating semi-decision algorithm for inhabitation. The usefulness of the framework is illustrated by revisiting and partially extending standard inhabitation related results for intersection types, as well as establishing new ones. It is shown how the notion of bounded multiset dimension emerges naturally and the relation between the two settings is clarified. A meaningful rank independent superset of the set of rank 2 types is identified for which EXPSPACE-completeness for inhabitation as well as for counting is proved. Finally, a standard result on negatively non-duplicated simple types is extended to intersection types

    Partial Derivative Automaton for Regular Expressions with Shuffle

    Get PDF
    We generalize the partial derivative automaton to regular expressions with shuffle and study its size in the worst and in the average case. The number of states of the partial derivative automata is in the worst case at most 2^m, where m is the number of letters in the expression, while asymptotically and on average it is no more than (4/3)^m

    A Unifying Framework for Type Inhabitation

    Get PDF
    In this paper we define a framework to address different kinds of problems related to type inhabitation, such as type checking, the emptiness problem, generation of inhabitants and counting, in a uniform way. Our framework uses an alternative representation for types, called the pre-grammar of the type, on which different methods for these problems are based. Furthermore, we define a scheme for a decision algorithm that, for particular instantiations of the parameters, can be used to show different inhabitation related problems to be in PSPACE

    The decidability of a fragment of BB′IW-logic

    Get PDF
    AbstractDespite its simple formulation, the decidability of the logic BB′IW has remained an open problem. We present here a decision procedure for a fragment of it, called the arity-1 formulas.The decidability proof is based on a representation of formulas called formula-trees, which is coupled with a proof method that computes long normal λ-terms that inhabit a formula.A rewriting-system is associated with such λ-terms, and we show that a formula admits a BB′IW-λ-term if and only if the associated rewriting-system terminates. The fact that termination is decidable is proved using a result on the finiteness of non-ascending sequences of n-tuples in Nn, which is equivalent to Kripke's Lemma

    On the average size of pd automata: an analytic combinatorics approach

    Get PDF
    The partial derivative automaton (NFA_PD) is usually smaller than other non-deterministic finite automata constructed from a regular expression, and it can be seen as a quotient of the Glushkov automaton (NFA_POS). By estimating the number of regular expressions that have epsilon as a partial derivative, we compute a lower bound of the average number of mergings of states in NFA_POS. and describe its asymptotic behaviour. This depends on the alphabet size, k, and its limit, as k goes to infinity, is 1. The lower bound corresponds exactly to consider the NFA_PD automaton for the marked version of the RE, i.e. where all its letters are made different. Experimental results suggest that the average number of states of this automaton, and of the NFA_PD automaton for the unmarked RE, are very close to each other

    Generating Normal Inhabitants of Types With a Common Structure

    No full text
    In [10] it was shown that it is possible to describe the set of normal inhabitants of a given type , in the standard simple type system, using an infinitary extension of the concept of context-free grammar, which allows for an infinite number of non-terminal symbols as well as production rules. The set of normal inhabitants of corresponds then to the set of terms generated by this, possibly infinitary, grammar plus all terms obtained from those by -reduction. In this paper we show that the set of normal inhabitants of a type can in fact be described using a standard (finite) contextfree grammar, and more interestingly that the sets of normal inhabitants of all types with a same structure are described by context-free grammars which share one unique underlying structure. The definition of a common scheme for these grammars, which depends uniquely on the given type structure, is based on an alternative representation for types, introduced in [4], which gives us a better insight on the nature of a type's structure and its relation to the structure of the set of its normal inhabitants
    corecore